package com.balance.anole.client.common.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.balance.anole.admin.to.AgentTO;
import com.balance.anole.admin.to.ShopTO;
import com.balance.anole.admin.to.StaffInfoTO;
import com.balance.anole.business.to.BusinessDateTO;
import com.balance.anole.business.to.ProductItemTO;
import com.balance.anole.business.to.ProductTO;
import com.balance.anole.business.vo.ProductItemSearchTO;
import com.balance.anole.business.vo.ProductSearchTO;
import com.balance.anole.common.to.CodeLookTO;
import com.balance.anole.erp.common.model.ProductItemVO;

public interface CommonService {

	/**
	 * Search product item by product item id.
	 * @param pdtItemId
	 * @return ProductItemTO
	 */
	public ProductItemTO getPdtItemById(String pdtItemId);

	/**
	 * Get a list of product items by given search conditions. If the condition field
	 * is empty, the condition will be ignored. The logical relationship between the conditions
	 * is AND.
	 *
	 * @param ProductItemTO
	 * @return
	 */
	public List<ProductItemVO> getProductItems(ProductItemSearchTO searchTO);

	/**
	 * List staffs of input agent.
	 * @param agentId
	 * @return List<StaffInfoTO>
	 */
	public List<StaffInfoTO> getListOfStaffUnderSameAgent(String agentId);

	/**
	 * @param sn
	 * @return
	 */
	public ProductItemTO getPdtItemBySN(String sn);

	/**
	 * @param codeTypeId
	 * @param codeId
	 * @return
	 */
	public CodeLookTO getCodeLookTOByCodeTypeAndCodeId(String codeTypeId, String codeId);

	/**
	 * Get business date from system.
	 * @param null
	 * @return BusinessDateTO
	 */
	public BusinessDateTO getBusinessDate();

	/**
	 * Insert or update business date.
	 *
	 * @param businessDateTO
	 */
	public void insertOrUpdateBusinessDate(BusinessDateTO businessDateTO);

	/**
	 * Get business date TO which current business date value is the same as given date.
	 * @return
	 */
	public BusinessDateTO getBusinessDateByCurrentBusinessDate(Date currentBusinessDate);

	/**
	 * Create or update BusinessDateTO
	 * @param null
	 * @return null
	 */
	public boolean synchronizeBusinessDate();

	/**
	 * @param codeTypeIds
	 * @return
	 */
	public Map<String, List<CodeLookTO>> getCodeLooksByCodeTypes(String[] codeTypeIds);

	/**
	 * @param searchTO
	 * @return
	 */
	public List<ProductTO> getProducts(ProductSearchTO searchTO);

	/**
	 * @param agentTO
	 * @return
	 */
	public ShopTO getShop(AgentTO agentTO);

}
